package com.city.controller.supervise;

import com.city.config.BaiduMap;
import com.city.domain.supervise.ImpLocation;
import com.city.repository.supervise.ImpLocationRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.List;
import java.util.Map;

/**
 * @deprecation 决策分析及督查督办子系统（ICU大数据挖掘分析系统）
 * @email leichuqiao@126.com
 * @author 雷楚桥
 * @date 2018-07-06 21:28
 */
@Controller
@RequestMapping("/supervise")
public class SuperviseController {

    @Autowired
    private ImpLocationRepository impLocationRepository;

    /**
     * @deprecation 决策分析及督查督办-主页
     * @author 雷楚桥
     * @date 2018-07-06 21:29
     */
    @RequestMapping("/index")
    public String index() {
        return "/supervise/index";
    }





    /**
     * @description 可视化页面测试
     * @author 肖丽娜
     * @date 2018/07/18 20:16
     */
    @RequestMapping("/show_test")
    public String show_test() { return "/supervise/show_test"; }


    /**
     * @param
     * @return java.lang.String
     * @deprecation 重点人管理
     * @author 何平
     * @date 2018/7/12 14:18
     */

    @RequestMapping("/keyperson")
    public String keyperson(Map<String,Object> map) {
        map.put("AK", BaiduMap.BAIDU_AK);
        return "/supervise/keyperson";
    }

    /**
     * @Author 何平 
     * @Description  返回重点用户的详细信息
     * @Date 13:28 2018/7/13
     * @Param []
     * @return java.lang.String
     **/
    @RequestMapping("/imp_person_detail")
    public String imp_person_detail(){return "/supervise/imp_person_detail";}

    /**
     * @Author 何平 
     * @Description  返回用户搜索的重点人信息
     * @Date 10:22 2018/7/20
     * @Param [map]
     * @return java.lang.String
     **/
    @RequestMapping("/imp_person_search")
    @ResponseBody
    public String imp_person_search(@RequestParam(value="username",required=false,defaultValue="") String username) {

        return "{\n" +
                "    \"map\":\n" +
                "    {\n" +
                "        \"p1\":[105.248977,28.308887],\n" +
                "        \"p2\":[105.237676,28.310605],\n" +
                "        \"p3\":[105.241489,28.305432],\n" +
                "        \"p4\":[105.231525,28.315282],\n" +
                "        \"p5\":[105.241592,28.30517],\n" +
                "        \"p6\":[105.231799,28.315083],\n" +
                "        \"p7\":[105.242158,28.305141],\n" +
                "        \"p8\":[105.232374,28.315378],\n" +
                "        \"p9\":[105.231992,28.305847],\n" +
                "        \"p10\":[105.242243,28.31949],\n" +
                "        \"p11\":[105.232396,28.3097],\n" +
                "        \"p12\":[105.248163,28.31943],\n" +
                "        \"p13\":[105.234945,28.309033],\n" +
                "        \"p14\":[105.234658,28.313217],\n" +
                "        \"p15\":[105.23313,28.30222],\n" +
                "        \"p16\":[105.248755, 28.317588]\n" +
                "     },\n" +
                "    \"person\":\n" +
                "    {\n" +
                "        \"username\":\"叶凡\",\n" +
                "        \"sex\":\"秀吉\",\n" +
                "        \"identity\":\"xxxx\",\n" +
                "        \"family\":\"三窑子洞窟\",\n" +
                "        \"intro\":\"他到这里挖煤炭，顺便吃个饭\"\n" +
                "    },\n" +
                "    \"data\":\n" +
                "    [{\n" +
                "        \"name\": \"p1\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p2\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p3\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p4\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p5\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p6\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p7\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p8\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p9\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p10\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p11\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p12\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p13\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p14\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p15\",\n" +
                "        \"value\": 390\n" +
                "    },{\n" +
                "        \"name\": \"p16\",\n" +
                "        \"value\": 390\n" +
                "    }],\n" +
                "    \"relationship\": [\n" +
                "        [{\"name\":\"p1\"},{\"name\":\"p2\",\"value\":95}],\n" +
                "        [{\"name\":\"p2\"},{\"name\":\"p3\",\"value\":90}],\n" +
                "        [{\"name\":\"p3\"},{\"name\":\"p4\",\"value\":80}],\n" +
                "        [{\"name\":\"p4\"},{\"name\":\"p5\",\"value\":70}],\n" +
                "        [{\"name\":\"p5\"},{\"name\":\"p6\",\"value\":60}]]\n" +
                "\n" +
                "}";
    }


    /**
     * @Author 何平
     * @Description  返回重点地点管理界面
     * @Date 19:07 2018/7/13
     * @Param []
     * @return java.lang.String
     **/
    @RequestMapping("/imp_location_manage")
    public String imp_location_manage(Map<String,Object> map){
        List<ImpLocation> list = impLocationRepository.findAll();
        map.put("AK",BaiduMap.BAIDU_AK);
        map.put("list",list);
        return "/supervise/imp_location_manage";
    }


    /**
     * @Author 何平 
     * @Description  返回重点地点详细信息
     * @Date 19:20 2018/7/13
     * @Param []
     * @return java.lang.String
     **/
    @RequestMapping("/imp_location_detail")
    public String imp_location_detail(){return "/supervise/imp_location_detail";}



    /**
     * @Author 何平 
     * @Description  重点地点的地点信息
     * @Date 19:59 2018/7/20
     * @Param [map]
     * @return java.lang.String
     **/
    @RequestMapping("/imp_location_map")
    public String imp_location_map(Map<String,Object> map) {
        map.put("AK", BaiduMap.BAIDU_AK);
        return "/supervise/imp_location_map";
    }


    /**
     * @Author 何平 
     * @Description  返回重点物件管理界面
     * @Date 19:43 2018/7/13
     * @Param []
     * @return java.lang.String
     **/
    @RequestMapping("/imp_thing_manage")
    public String imp_thing_manage(Map<String,Object> map){
        map.put("AK", BaiduMap.BAIDU_AK);
        return "/supervise/imp_thing_manage";
    }


    /**
     * @Author 何平 
     * @Description  返回重点事件详细信息
     * @Date 19:53 2018/7/13
     * @Param []
     * @return java.lang.String
     **/
    @RequestMapping("/imp_thing_detail")
    public String imp_thing_detail(){return "/supervise/imp_thing_detail";}


    /**
     * @Author 何平 
     * @Description  返回重点组织管理界面
     * @Date 20:01 2018/7/13
     * @Param []
     * @return java.lang.String
     **/
    @RequestMapping("/imp_organization_manage")
    public String imp_organization_manage(){return "/supervise/imp_organization_manage";}



    /**
     * @Author 何平 
     * @Description  返回重点组织的详细信息
     * @Date 20:18 2018/7/13
     * @Param []
     * @return java.lang.String
     **/
    @RequestMapping("/imp_organization_detail")
    public String imp_organization_detail(){return "/supervise/imp_organization_detail";}






    /**
     * @Author 何平 
     * @Description  返回重点组织地点信息
     * @Date 19:00 2018/7/20
     * @Param [map]
     * @return java.lang.String
     **/
    @RequestMapping("/imp_organization_map")
    public String imp_organization_map(Map<String,Object> map) {
        map.put("AK", BaiduMap.BAIDU_AK);
        return "/supervise/imp_organization_map";
    }


    /**
     * @Author 何平
     * @Description  分类事件管理
     * @Date 9:34 2018/7/14
     * @Param []
     * @return java.lang.String
     **/
    @RequestMapping("/thing_category_manage")
    public String thing_category_manage(){
        return "/supervise/thing_category_manage";
    }


    /**
     * @Author 肖丽娜
     * @return 返回分类事件管理详细信息
     */
    @RequestMapping("/thing_category_detail")
    public String thing_category_detail() { return "/supervise/thing_category_detail"; }


    /**
     * @Author 肖丽娜
     * @return 添加地点信息
     */
    @RequestMapping("/imp_location_addinfo")
    public String imp_location_addinfo() { return "/supervise/imp_location_addinfo"; }


    /**
     * @Author 肖丽娜
     * @return 添加组织信息
     */
    @RequestMapping("/imp_organization_addinfo")
    public String imp_organization_addinfo() { return "/supervise/imp_organization_addinfo"; }


    /**
     * @Author 肖丽娜
     * @return 添加事件信息
     */
    @RequestMapping("/imp_thing_addinfo")
    public String imp_thing_addinfo() { return "/supervise/imp_thing_addinfo"; }


    /**
     * @Author 肖丽娜
     * @return 添加物件分类信息
     */
    @RequestMapping("/thing_category_addinfo")
    public String thing_category_addinfo() { return "/supervise/thing_category_addinfo"; }

}
